#ifndef GAME_EXCEPTION_H
#define GAME_EXCEPTION_H

#include <exception>
#include <string>
#include <sstream>
using namespace std;

class GameException : public exception
{
public:
    GameException(): mMessage("Unknown"), mFunction("Unknown"), mFile("Unknown"), mLine(-1) {}
    GameException(string message, char* _file, long _line, char* _function) : mMessage(message), mFunction(_function), mFile(_file), mLine(_line) 
    {
        stringstream ss;
        ss <<"Message:"<<mMessage
            <<"\nFunction:\t"<<mFunction
            <<"\nFile:\t"<<mFile
            <<"\nLine:\t"<<mLine;
        mFullDescription = ss.str();
    }
    virtual ~GameException(){}

    virtual const char* what() const 
    {
        return mFullDescription.c_str();
    }

    virtual string getMessage() { return mMessage; }
    virtual string getFile() { return mFile; }
    virtual string getFunction() { return mFunction; }
    virtual long      getLine() { return mLine; }
    virtual string getFullDescription() { return mFullDescription; }

protected:
    string mMessage;
    string mFile;
    string mFunction;
    long   mLine;
    mutable string mFullDescription;
};






#endif